<html xmlns:th="http://www.thymeleaf.org" xmlns:x="http://www.w3.org/1999/html">
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <form id="testToBoyEditForm" method="post">
            <table class="grid">
                <input name="id" type="hidden" th:value="${testToBoy.id}">
                <tr>
                    <td></td>
                    <td><input name="id" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.id}"></td>
                    <td></td>
                    <td><input name="testcase" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.testcase}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="aliass" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.aliass}"></td>
                    <td></td>
                    <td><input name="alias2" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.alias2}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="bestConventionId" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.bestConventionId}"></td>
                    <td></td>
                    <td><input name="updateTime" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.updateTime}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="stars" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.stars}"></td>
                    <td>1:有效;2:被删除</td>
                    <x:select id="testToBoyEditStatus" name="status" type="dbStatus" class="easyui-combobox"
                              data-options="width:160,height:29,editable:false,panelHeight:'auto'"/>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="userId" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.userId}"></td>
                    <td></td>
                    <td><input name="onlyISee" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.onlyISee}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="type" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.type}"></td>
                    <td>1:加密</td>
                    <td><input name="encrypted" type="text" placeholder="请输入1:加密" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.encrypted}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="key2" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.key2}"></td>
                    <td></td>
                    <td><input name="order2" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.order2}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="latestAccessDetailTime" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.latestAccessDetailTime}"></td>
                    <td></td>
                    <td><input name="createTime" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.createTime}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="alias" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.alias}"></td>
                <tr>
                    <td></td>
                    <td><input name="isOffen" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${testToBoy.isOffen}"></td>
                </tr>
            </table>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('#testToBoyEditForm').form({
            url: basePath + '/testToBoy/edit',
            onSubmit: function () {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success: function (result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.code === 1) {
                    //之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为list页面预定义好了
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#testToBoyEditForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });

        $("#testToBoyEditStatus").val('[[${testToBoy.status}]]');
    });
</script>
